var express = require('express');
var router = express.Router();

const {
  getData,
  findPartyByPage, 
  addParty, 
  findOneById, 
  updateOneById, 
  deleteOneById,
} = require("../controller/party");
const { authFilter } = require("../middlewares/auth");

class PartyRouter {
  static initRouter() {
    router.get('/', authFilter, findPartyByPage);
    router.post('/0', authFilter, addParty);
    router.get('/getData', authFilter, getData);
    router.get('/:id', authFilter, findOneById);
    router.put('/:id', authFilter, updateOneById);
    router.delete('/:id', authFilter, deleteOneById);
    return router;
  }
}
module.exports = PartyRouter.initRouter();